"""
参数化, 标准而言, 应该将数据和脚本进行分离
1. data.json: 专门存放测试数据
2. read_data.py: 专门读取JSON数据
3. test*.py: 专门进行脚本代码的编写

"""
import pytest

from Day10.common.hm_05_read_data import build_data
from Day10.common.tools import add

class TestAdd(object):

    @pytest.mark.parametrize("x, y, expect", build_data())
    def test_add(self, x, y, expect):
        result = add(x, y)
        assert result == expect